import { Encrypt,Decrypt} from "@/utils/CryptoJS";
const KEY = 'PHONE_KEY' 
const store = localStorage
/**
 * 保存localStorage中的phone
 * @param {*} phone 
 */
export const savePhone = phone =>{
   store.setItem(KEY,Encrypt(phone))
}
/**
 * 获取localStorage中的phone
 */
export const getPhone = () =>{

   let phone = store.getItem(KEY) 
   if (phone) {
      return  Decrypt(phone)
     }
      return phone
      
    
}
/**
 * 移除localStorage中的phone
 */
export const removePhone = () =>{
  store.removeItem(KEY)
}